<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>


<div id="user_main">
	<div class="content">

		<h3>我的信息</h3>

		<hr>
		
	<div style="width: 500px; padding: 10px; margin:auto;">
		<div data-options="region:'north'">
			<form id='info_form' method="post">
				<input name="id" type="hidden" value='${user.id}'>
				<table style="margin: auto;">
					<tr>
						<td><label for="name">用户编码:</label></td>
						<td><input class="easyui-textbox" type="text" 
							name="customerNo" value ="${user.customerNo}" 
							readonly="readonly"/>
						</td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>					
					<tr>
						<td><label for="name">登录名:</label></td>
						<td><input class="easyui-textbox" type="text"
							name="login_name" value = "${user.login_name}" 
							readonly="readonly" data-options="required:true,missingMessage:'请输入用户名'" /></td>
					</tr>					
					<tr>
						<td></td>
						<td></td>
					</tr>
					
					<tr>
						<td><label for="name">用户姓名:</label></td>
						<td><input class="easyui-textbox" type="text"
							name="user_name" value = "${user.user_name}" 
							data-options="required:true,missingMessage:'请输入用户名'" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">公司名称:</label></td>
						<td><input class="easyui-textbox" name="companyName" value="${user.companyName}"
							data-options="multiline:true" style="height: 50px;" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">公司地址:</label></td>
						<td><input class="easyui-textbox" name="companyAddr" value="${user.companyAddr}" 
							data-options="multiline:true" style="height: 50px;" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">公司电话:</label></td>
						<td><input class="easyui-textbox" name="companyPhone" value="${user.companyPhone}" 
							data-options="validType:'tel'" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">手机：</label></td>
						<td><input class="easyui-textbox" name="user_mobile" value="${user.user_mobile}" 
							data-options="validType:'mobile'" /></td>
					</tr>
					
					<tr>
						<td></td>
						<td></td>
					</tr>
				<tr>
					<td><label for="alipayNo">支付宝账号：</label></td>
					<td><input class="easyui-textbox" name="alipayNo" value="${user.alipayNo}"/></td>
				</tr>
				<tr>
					<td></td>
					<td></td>
				</tr>
					<tr>
						<td><label for="name">QQ号：</label></td>
						<td><input class="easyui-textbox" name="qqNumber" value="${user.qqNumber}" 
							data-options="validType:'QQ'" /></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">当前业务：</label></td>
						<td><select class="easyui-combobox" name="transaction" data-options="panelHeight:'auto'" value="${user.transaction}" >
								<option value="FBA换标">FBA换标</option>
								<option value="FBA中转">FBA中转</option>
								<option value="海外仓储">海外仓储</option>
								<option value="FBA退货业务">FBA退货业务</option>
						</select></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">主要产品：</label></td>
						<td><input class="easyui-textbox" name="product" value="${user.product}"/></td>
					</tr>
					<tr>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td><label for="name">常用email：</label></td>
						<td><input class="easyui-textbox" name="user_email" value="${user.user_email}" 
							data-options="validType:'email'" /></td>
					</tr>
				</table>
			</form>
		</div>
		<div data-options="region:'center'" style="text-align: center">
			<br /> <a id="update_btn" href="javascript:void(0);"
				class="easyui-linkbutton" data-options="iconCls:'icon-ok'">提交</a>
		</div>

	</div>
</div>

<script type="text/javascript">
	$("#update_btn").click(function() {
		$("#info_form").form('submit', {
			url : "customer/user/update",
			dataType : 'json',//无效？？？
			onSubmit : function() {
				var isValid = $(this).form('validate');
				return isValid;
			},
	
			success : function(data) {
				//$.messager.alert('提示信息', data);
				var data = eval("(" + data + ")");
				$.messager.alert('提示信息', data.msg);
			},
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				alert(XMLHttpRequest.status);
				alert(XMLHttpRequest.readyState);
				alert(textStatus);
				alert("异常");
			}
		});
	});
</script>
